# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=cxxopts
pkgver=3.1.1
pkgrel=0
pkgdesc="Lightweight C++ command line option parser as a header only library"
url="https://github.com/jarro2783/cxxopts"
arch="noarch"
license="MIT"
makedepends="cmake ninja"
subpackages="$pkgname-dev"
source="https://github.com/jarro2783/cxxopts/archive/v$pkgver/cxxopts-$pkgver.tar.gz"

build() {
	cmake -G Ninja -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DCXXOPTS_BUILD_TESTS=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
248e54e23564660467c7ecf50676b86d3cd10ade89e0ac1d23deb71334cb89cc5eb50f624b385d5119a43ca68ff8b1c74af82dc699b5ccfae54d6dcad4fd9447  cxxopts-3.1.1.tar.gz
"
